<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>结构参数</title>
</head>
<body>
<script>
    //把一个对象解构到不同的对象中
    function a({subject, verb, object}) {
        return `${subject},${verb},${object}`;
    }
    const o = {
        subject:"I",
        verb:"love",
        object:"JavaScript"
    };
    console.log(a(o));
    // 解构一个数组
    const arr = ["I","love","java"];
    function b([subject,verb,object]) {
        return `${subject},${verb},${object}`;
    }
    console.log(b(arr));
</script>
</body>
</html>